package com.swp.oa.util;

import java.net.MalformedURLException;
import java.net.URL;

/**
 * 文件创库帮助类
 * */
public class LibraryUtil {

	public static String resolveLibraryUrlToRelPath(String elemUrl) {
		
		// 相对路径相对文件仓根目录，不包含根目录
		// http://localhost:8080/Library/ -> ""
		// http://localhost:8080/Library/cots -> "cots"
		URL url = null;
		try {
			url = new URL(elemUrl);
			return url.getPath();
		} catch (MalformedURLException e) {
			e.printStackTrace();
			return null;
		}
		
		
	}
}
